<?php
if(isset($_REQUEST['agency_id'])){
	$v_agency_id=$_REQUEST['agency_id'];
}

if(_is_sqlserver()){
	// Lay so luong tthc co trong co quan hanh chinh
	$cmd = @mssql_init("ONEGATE_AF_AFCountByAgency", $conn);
	@mssql_bind($cmd, "@p_agency_id",$v_agency_id, SQLINT4);
	$result = @mssql_execute($cmd);
	$arr_count = _get_row_to_array($result);
	@mssql_free_result($result);
	
	$v_total_af =$arr_count['0']['0'];

	//Lay danh sach linh vuc
	$cmd = @mssql_init("KM_AF_CateGetAllByAgency",$conn);
	@mssql_bind($cmd,"@p_agency_id",$v_agency_id,SQLINT4);	
	$rs_all_cate = @mssql_execute($cmd);
	$arr_all_cate = _get_row_to_array($rs_all_cate); 
	@mssql_free_result($rs_all_cate);
	
	// Lay danh sach cqhc de dua vao combobox
	$cmd = @mssql_init("KM_AF_AgencyGetForCombobox", $conn);	
	$result = @mssql_execute($cmd);
	$arr_all_agency = _get_row_to_array($result);
	@mssql_free_result($result);
}
?>